﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using NextCMS.Models;

/// <summary>
/// Summary description for TemplatesHelper
/// </summary>
public class TemplatesHelper: ITemplate
{
    ITemplate templates = null;
    public TemplatesHelper()
    {
        templates = (ITemplate)NextCMS.DataAccess.Entities.CreateInstance<ITemplate>();
    }
    public TemplateModel GetById(int id)
    {
        return templates.GetById(id);
    }
    public IEnumerable<TemplateModel> GetAllBySiteId(int SiteId)
    {
        return templates.GetAllBySiteId(SiteId);
    }
    public int Save(TemplateModel page)
    {
        return templates.Save(page);
    }
    // Delete Record
    public void Delete(int id)
    {
        templates.Delete(id);
    }

    // Edit Record
    public void Edit(TemplateModel page)
    {
        templates.Edit(page);
    }

    public void Dispose()
    {
        templates.Dispose();
        templates = null;
    }
}